package com.family.gmall.product.controller;

import com.family.gmall.common.result.Result;
import com.family.gmall.product.service.TestService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * @Auther: family
 * @Date: 2023/7/15 10:55
 * @Description:
 */
@Api(tags = "测试接口")
@RestController
@RequestMapping("/admin/product/test")
public class TestController {

    @Resource
    private TestService testService;

    @GetMapping("testLock")
    public Result testLock() {
        testService.testLock();
        return Result.ok();
    }

    @GetMapping("read")
    public Result<String> read() {
        String msg = testService.readLock();
        return Result.ok(msg);
    }

    @GetMapping("write")
    public Result<String> write() {
        String msg = testService.writeLock();
        return Result.ok(msg);
    }
}
